package pl.bizuteria.sklep.admin.client.activity.bracelet;

import java.util.List;
import java.util.Set;
import java.util.logging.Logger;

import pl.bizuteria.sklep.admin.client.activity.product.AbstractProxyListActivity;
import pl.bizuteria.sklep.admin.client.ui.product.IProxyListView;
import pl.bizuteria.sklep.api.shared.proxy.BraceletProxy;
import pl.bizuteria.sklep.api.shared.request.ApplicationRequestFactory;

import com.google.gwt.place.shared.PlaceController;
import com.google.gwt.view.client.Range;
import com.google.web.bindery.requestfactory.shared.Request;

public class BraceletListActivity extends AbstractProxyListActivity<BraceletProxy> {
	static Logger logger = Logger.getLogger(BraceletListActivity.class.getName());

	public BraceletListActivity(IProxyListView<BraceletProxy> braceletView,
			PlaceController placeController, ApplicationRequestFactory requestFactory) {
		super(braceletView, placeController, BraceletProxy.class, requestFactory);
	}

	@Override
	protected Request<List<BraceletProxy>> createFindRequest(Range range) {
		return requestFactory.braceletRequest().findAll(range.getStart(), range.getLength());
	}

	@Override
	protected Request<Void> createDeleteRequest(
			Set<BraceletProxy> elements) {
		return requestFactory.braceletRequest().remove(elements);
	}

	@Override
	protected Request<Integer> createCountRequest() {
		return requestFactory.braceletRequest().count();
	}

	@Override
	protected Logger logger() {
		return logger;
	}

}
